unit Main;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Memo2: TMemo;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation
uses Progress;
{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
  List : TStringList;
  i,iCount : Integer;
begin
  iCount := 50000;

  List := TStringList.Create;
  ProgressShow(nil,'aaa');
  try
    ProgressMax(iCount+1);
    List.Clear;
    Memo1.Lines.Add('List1:');
    Memo1.Lines.Add(FormatDateTime('yyyy.mm.dd hh:nn:ss:zzz',now));
    for i := 0 to iCount do
    begin
      ProgressStepIt;
      List.Add(IntToStr(i));
    end;
    Memo1.Lines.Add(FormatDateTime('yyyy.mm.dd hh:nn:ss:zzz',now));

    List.Clear;
    Memo1.Lines.Add('List2:');
    Memo1.Lines.Add(FormatDateTime('yyyy.mm.dd hh:nn:ss:zzz',now));
    for i := 0 to iCount do
    begin
      List.Add(IntToStr(i));
    end;
    Memo1.Lines.Add(FormatDateTime('yyyy.mm.dd hh:nn:ss:zzz',now));
  {
    Memo2.Lines.Clear;
    Memo2.Lines.BeginUpdate;
    Memo1.Lines.Add('Memo2:');
    Memo1.Lines.Add(FormatDateTime('yyyy.mm.dd hh:nn:ss:zzz',now));
    Memo2.Lines.AddStrings(List);
  //  for i := 0 to iCount do
  //    Memo2.Lines.Add(IntToStr(i));
    Memo2.Lines.EndUpdate;
    Memo1.Lines.Add(FormatDateTime('yyyy.mm.dd hh:nn:ss:zzz',now));
   }
  finally
    ProgressClose;
    List.Free;
  end;
end;

end.
